<?php

class Soul_Request_Factory {
	
//	public static $httpApplicationClass = 'Soul_Request_Application_Http';
//	public static $cmdApplicationClass = 'Soul_Request_Application_Command';
//	public static $routerClass = 'Soul_Request_Http_Router';
//    public static $identityClass = 'Soul_Request_Http_Identity';
//    public static $historyClass = 'Soul_Request_Http_History';
//    public static $messagerClass = 'Soul_Request_Http_Messager';
//    public static $requestClass = 'Soul_Request_Http_Request';
//    public static $responseClass = 'Soul_Request_Http_Response';
//    public static $sessionClass = 'Soul_Request_Http_Session';
//    public static $variablesClass = 'Soul_Request_Http_Variables';
//    public static $handlerClass = 'Soul_Request_Http_Handler';
//    public static $filterClass = 'Soul_Request_Http_Filter';
//    public static $contextClass = 'Soul_Request_Http_Context';
    
    private static $_router = NULL;
    private static $_identity = NULL;
    private static $_request = NULL;
    private static $_response = NULL;
    private static $_session = NULL;
    private static $_messager = NULL;
    private static $_handler = NULL;
    private static $_filter = NULL;
    private static $_context = NULL;
    private static $_httpApplication = NULL;
    private static $_cmdApplication = NULL;
    
    public static function getFilter(){
    	if(is_null(self::$_filter)){
    		self::$_filter = Soul_Loader::loadSingleton('request_http_filter');
    	}
    	return self::$_filter;
    }
    
    public static function getRouter(){
    	if(is_null(self::$_router)){
    		self::$_router = Soul_Loader::loadSingleton('request_http_router');
    	}
    	return self::$_router;
    }

    public static function getIdentity(){
        if(is_null(self::$_identity)){
            self::$_identity = Soul_Loader::loadSingleton('request_http_identity');
        }
        return self::$_identity;
    }

    public static function getRequest(){
        if(is_null(self::$_request)){
            self::$_request = Soul_Loader::loadSingleton('request_http_request');
        }
        return self::$_request;
    }

    public static function getResponse(){
        if(is_null(self::$_response)){
            self::$_response = Soul_Loader::loadSingleton('request_http_response');
        }
        return self::$_response;
    }

    public static function getSession(){
        if(is_null(self::$_session)){
            self::$_session = Soul_Loader::loadSingleton('request_http_session');
        }
        return self::$_session;
    }

    public static function getMessager(){
        if(is_null(self::$_messager)){
            self::$_messager = Soul_Loader::loadSingleton('request_http_messager');
        }
        return self::$_messager;
    }
    
    public static function getHandler(){
        if(is_null(self::$_handler)){
            self::$_handler = Soul_Loader::loadSingleton('request_http_handler');
        }
        return self::$_handler;    	
    }    
    
    public static function getHttpApplication(){
        if(is_null(self::$_httpApplication)){
            self::$_httpApplication = Soul_Loader::loadSingleton('request_application_http');
        }
        return self::$_httpApplication;    	
    }
    
    public static function getCmdApplication(){
        if(is_null(self::$_cmdApplication)){
            self::$_cmdApplication = Soul_Loader::loadSingleton('request_application_command');
        }
        return self::$_cmdApplication;     	
    }
}